package com.rt.tmpt.controller.springmvc.admin;

import com.rt.easyjava.common.base.Result;
import com.rt.tmpt.dto.A2UserDto;
import com.rt.tmpt.service.IMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Api(tags = "用户控制类")
@Controller
@RequestMapping("/innerService")
public class AuthAction {

	@Resource private IMenuService menuService;

	@ApiOperation(value = "通过登录名找用户对象：提供给认证服务器使用")//swagger 当前接口注解
	@GetMapping(value = "/getUserByLoginName/{loginName}")
	@ResponseBody
	public Result<A2UserDto> getUserByLoginName(@PathVariable("loginName") String loginName){
		Result<A2UserDto> result = new Result();
		A2UserDto empDto = menuService.getUserByLoginname(loginName);
		result.setObj(empDto);
		return result.success();
	}


}
